home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / asm_subr.arc / DECDOUBL < prev    next >
Encoding:
Text File  |  1985-12-27  |  1.3 KB  |  47 lines

  1. ;-------------------------decdoubl routine begins--------------------------+
  2. ; from BLUEBOOK OF ASSEMBLY ROUTINES FOR IBM PC & XT.
  3. ;         page : 103
  4. ;
  5. ; NAME  DECDOUBL
  6. ;
  7. ; ROUTINE FOR Doubling A Temporary Decimal Floating Point Number
  8. ;
  9. ; FUNCTION: This routine multiplies a temporary decimal floating point
  10. ; number by two.
  11. ;
  12. ; INPUT: Upon ebtry DS:DI points to a temporary decimal floating point
  13. ; number.
  14. ;
  15. ; OUTPUT: Upon exit the number has been doubled.
  16. ;
  17. ; REGISTERS USED:  AX, CX and DI are modified.
  18. ;
  19. ; SEGMENTS REFERENCED:  The data segment contains storage for the temporary
  20. ; decimal floating poiint number.
  21. ;
  22. ; ROUTINES CALLED:  None
  23. ;
  24. ; SPECIAL NOTES: This is a near procedure called by FPOUT
  25. ;
  26. ; ROUTINE TO MULTIPLY TEMPORARY DECIMAL FLOATING POINT NUMBER BY 2 - RESULT
  27. ; NOT NORMALIZED.
  28. ;
  29. decdoubl    proc    near
  30. ;
  31.     mov    cx,25        ; for a count of 25
  32.     mov    ah,0        ; clear previous carry
  33. ;
  34. decdoubl1:
  35.     mov    al,[di]        ; get digit
  36.     sal    al,1        ; multip0ly by 2
  37.     and     al,ah        ; add the carry
  38.     aam            ; adjust for decimal multiplication
  39.     mov    [di],al        ; put the byte back
  40.     inc    di        ; point to next byte
  41.     loop    decdoubl1
  42. ;
  43.     ret            ; return
  44. ;
  45. decdoubl    endp
  46. ;-------------------------decdoubl routine ends---------------------------+
  47.